package com.tj.bo.user.client.enums;

/**
 * 注册方式
 * User: binary
 * Date: 2020/6/10
 * Time: 下午5:28
 */
public enum UserRegisterTypeEnum {

    MOBILE(0,"mobile"),
    EMAIL(1, "EMAIL"),
    FACEBOOK(2, "FACEBOOK"),
    IMEI(3, "IMEI"),
    GOOGLE(4, "GOOGLE");

    private Integer type;

    private String desc;

    UserRegisterTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public UserRegisterTypeEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public UserRegisterTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static UserRegisterTypeEnum getEnum(Integer type) {
        UserRegisterTypeEnum e = null;
        for (UserRegisterTypeEnum enumObj : UserRegisterTypeEnum.values()) {
            if (enumObj.getType().equals(type)) {
                e = enumObj;
                break;
            }
        }
        return e;
    }
}
